home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / xuldoc / nsIXULDocument.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  165 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is Mozilla Communicator client code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. /*
  39.  
  40.   An XUL-specific extension to nsIDocument. Includes methods for
  41.   setting the root resource of the document content model, a factory
  42.   method for constructing the children of a node, etc.
  43.  
  44.   XXX This should really be called nsIXULDocument.
  45.  
  46.  */
  47.  
  48. #ifndef nsIXULDocument_h___
  49. #define nsIXULDocument_h___
  50.  
  51. #include "nsISupports.h"
  52. #include "nsString.h"
  53.  
  54. class nsForwardReference;
  55. class nsIAtom;
  56. class nsIDOMElement;
  57. class nsIPrincipal;
  58. class nsIRDFResource;
  59. class nsISupportsArray;
  60. class nsIXULPrototypeDocument;
  61. class nsIXULTemplateBuilder;
  62. class nsIURI;
  63. class nsIContent;
  64. class nsIRDFDataSource;
  65.  
  66. // {954F0811-81DC-11d2-B52A-000000000000}
  67. #define NS_IXULDOCUMENT_IID \
  68. { 0x954f0811, 0x81dc, 0x11d2, { 0xb5, 0x2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
  69.  
  70. /**
  71.  * XUL extensions to nsIDocument
  72.  */
  73.  
  74. class nsIXULDocument : public nsISupports
  75. {
  76. public:
  77.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IXULDOCUMENT_IID)
  78.  
  79.   // The resource-to-element map is a one-to-many mapping of RDF
  80.   // resources to content elements.
  81.  
  82.   /**
  83.    * Add an entry to the ID-to-element map.
  84.    */
  85.   NS_IMETHOD AddElementForID(const nsAString& aID, nsIContent* aElement) = 0;
  86.  
  87.   /**
  88.    * Remove an entry from the ID-to-element map.
  89.    */
  90.   NS_IMETHOD RemoveElementForID(const nsAString& aID, nsIContent* aElement) = 0;
  91.  
  92.   /**
  93.    * Get the elements for a particular resource in the resource-to-element
  94.    * map. The nsISupportsArray will be truncated and filled in with
  95.    * nsIContent pointers.
  96.    */
  97.   NS_IMETHOD GetElementsForID(const nsAString& aID, nsISupportsArray* aElements) = 0;
  98.  
  99.   /**
  100.    * Add a "forward declaration" of a XUL observer. Such declarations
  101.    * will be resolved when document loading completes.
  102.    */
  103.   NS_IMETHOD AddForwardReference(nsForwardReference* aForwardReference) = 0;
  104.  
  105.   /**
  106.    * Resolve the all of the document's forward references.
  107.    */
  108.   NS_IMETHOD ResolveForwardReferences() = 0;
  109.  
  110.   /**
  111.    * Set the master prototype.
  112.    */
  113.   NS_IMETHOD SetMasterPrototype(nsIXULPrototypeDocument* aDocument) = 0;
  114.  
  115.   /**
  116.    * Get the master prototype.
  117.    */
  118.   NS_IMETHOD GetMasterPrototype(nsIXULPrototypeDocument** aPrototypeDocument) = 0;
  119.  
  120.   /**
  121.    * Set the current prototype
  122.    */
  123.   NS_IMETHOD SetCurrentPrototype(nsIXULPrototypeDocument* aDocument) = 0;
  124.  
  125.   /**
  126.    * Notify the XUL document that a subtree has been added
  127.    */
  128.   NS_IMETHOD AddSubtreeToDocument(nsIContent* aElement) = 0;
  129.  
  130.   /**
  131.    * Notify the XUL document that a subtree has been removed
  132.    */
  133.   NS_IMETHOD RemoveSubtreeFromDocument(nsIContent* aElement) = 0;
  134.  
  135.   /**
  136.    * Attach a XUL template builder to the specified content node.
  137.    * @param aBuilder the tmeplate builder to attach, or null if
  138.    *   the builder is to be removed.
  139.    */
  140.   NS_IMETHOD SetTemplateBuilderFor(nsIContent* aContent, nsIXULTemplateBuilder* aBuilder) = 0;
  141.  
  142.   /**
  143.    * Retrieve the XUL template builder that's attached to a content
  144.    * node.
  145.    */
  146.   NS_IMETHOD GetTemplateBuilderFor(nsIContent* aContent, nsIXULTemplateBuilder** aResult) = 0;
  147.  
  148.   /**
  149.    * Callback notifying this document when its XUL prototype document load
  150.    * completes.  The prototype load was initiated by another document load
  151.    * request than the one whose document is being notified here.
  152.    */
  153.   NS_IMETHOD OnPrototypeLoadDone() = 0;
  154.  
  155.   /**
  156.    * Notify the XUL document that it's being hidden
  157.    */
  158.   NS_IMETHOD OnHide() = 0;
  159. };
  160.  
  161. // factory functions
  162. nsresult NS_NewXULDocument(nsIXULDocument** result);
  163.  
  164. #endif // nsIXULDocument_h___
  165.